/*************************************************************************
 *                    free                     *
 *************************************************************************
 *************************************************************************
 * Filename	   : section.h
 * Description   : This file is used to TODO
 * Version	   : 1.0
 * History       :
 free 2013-4-15  Create
 *************************************************************************/

#ifndef _SECTION_H_
#define _SECTION_H_

typedef struct stSection
{
	unsigned char *pucData;
	struct stSection *pstNext;
} SECTION;

typedef struct
{
	unsigned int table_id :8;
	unsigned int section_syntax_indicator :1;
	unsigned int reserved_future_use :1;
	unsigned int reserved1 :2;
	unsigned int section_length :12;
	unsigned int table_id_extension :16;
	unsigned int reserved2 :2;
	unsigned int version_number :5;
	unsigned int current_next_indicator :1;
	unsigned int section_number :8;
	unsigned int last_section_number :8;
} SECTION_HEADER;

void FreeSectionList(SECTION **ppstSections);
SECTION *GetSectionList(FILE *pInputFile, long int liFirstPackageOffset, int iPackageLength, int iPackagePID, int iTableID);

#endif /* SECTION_H_ */
